acess variable in sub function